{% set pypi_name = 'python-monascaclient' %}
{% set upstream_version = upstream_version('2.2.1') %}
{% set rpm_release = '1' %}
{% set source = url_pypi() %}

Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Python API and CLI for OpenStack Monasca
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('PrettyTable') }}
BuildRequires:  {{ py3('PyYAML') }}
BuildRequires:  {{ py3('fixtures') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('openstackdocstheme') }}
BuildRequires:  {{ py3('osc-lib') }}
BuildRequires:  {{ py3('oslo.concurrency') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('oslo.utils') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('testscenarios') }}
BuildRequires:  {{ py3('testtools') }}
BuildArch:      noarch

%description
This is a client library for Monasca built to interface with the Monasca API. It
provides a Python API (the ``monascaclient`` module) and a command-line tool
(``monasca``).

%package -n python3-monascaclient
Summary:        Python API and CLI for OpenStack Monasca
Requires:       {{ py3('Babel') }}
Requires:       {{ py3('PrettyTable') }}
Requires:       {{ py3('PyYAML') }}
Requires:       {{ py3('iso8601') }}
Requires:       {{ py3('osc-lib') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('oslo.utils') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('requests') }}
Requires:       {{ py3('six') }}
%if 0%{?suse_version}
Obsoletes:      {{ py2name(py_versions='py2') }} < 2.0.0
%endif

%description -n python3-monascaclient
This is a client library for Monasca built to interface with the Monasca API. It
provides a Python API (the ``monascaclient`` module) and a command-line tool
(``monasca``).

The Monasca Client was written using the OpenStack Heat Python client as a framework.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
%{py3_build}

%install
%{py3_install}

%check
python3 -m stestr.cli run

%files -n python3-monascaclient
%doc README.rst
%license LICENSE
%{python3_sitelib}/monascaclient
%{python3_sitelib}/*.egg-info
%{_bindir}/monasca

%changelog
